#ifndef __M_AVPLAYLIST_H__
#define __M_AVPLAYLIST_H__

#include "file.h"

typedef struct AvplayListEntry
{
    struct AvplayListEntry *next;
    struct AvplayListEntry *previous;
    char *name;
    char *path;
    int type;
} AvplayListEntry;

typedef struct
{
    AvplayListEntry *head;
    AvplayListEntry *tail;
    int length;
} AvplayList;

AvplayListEntry *avplayListCopyEntry(AvplayListEntry *src);
AvplayListEntry *avplayListGetEntryByName(AvplayList *list, const char *name);
AvplayListEntry *avplayListGetEntryByNumber(AvplayList *list, int n);
int avplayListGetNumberByName(AvplayList *list, const char *name);

void avplayListAddEntry(AvplayList *list, AvplayListEntry *entry);
int avplayListRemoveEntry(AvplayList *list, AvplayListEntry *entry);
int avplayListRemoveEntryByName(AvplayList *list, const char *name);

void avplayListEmpty(AvplayList *list);

int avplayListGetEntries(AvplayList *playlist, const FileList *filelist);

#endif